package com.cloudcc.mobile.dao.impl;

import com.cloudcc.cloudframe.net.RequestListener;
import com.cloudcc.cloudframe.net.async.JsonObjectRequest;
import com.cloudcc.cloudframe.util.GsonUtil;
import com.cloudcc.mobile.dao.BaseEngine;
import com.cloudcc.mobile.dao.Att;
import com.cloudcc.mobile.entity.EventTaskEntity;
import com.cloudcc.mobile.manager.RunTimeManager;
import com.cloudcc.mobile.manager.UrlManager;
import com.loopj.android.http.RequestParams;

public class EventTaskEngineImpl extends BaseEngine implements Att {

	@Override
	public void sendEvent(EventTaskEntity renwu, RequestListener li) {
		EventTaskEntity[] renwus =new EventTaskEntity[1];
		renwus[0] =renwu;
		RequestParams params =new RequestParams();
		params.put("serviceName", "insert");
		params.put("objectApiName", "Event");
		params.put("data", GsonUtil.Object2Json(renwus));
		params.put("binding",RunTimeManager.getInstance().getServerBinding());
		JsonObjectRequest request =new JsonObjectRequest();
		request.setRequestListener(li);
		sendPost(UrlManager.getInterfaceUrl(), params, request);
	}

}
